{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load wger_extras %}

{% block title %}{% translate "Ingredient weight units" %}{% endblock %}


{% block content %}
    <ul class="list-group">
        {% for unit in unit_list %}
            <li class="list-group-item ">
                <div class="btn-group float-end">
                    <button type="button" class="btn btn-light dropdown-toggle btn-sm"
                            data-bs-toggle="dropdown">
                        <span class="{% fa_class 'cog' %}"></span>
                    </button>
                    <div class="dropdown-menu dropdown-menu-right" role="menu">
                        {% translate 'Edit' as text %}
                        {% url 'nutrition:weight_unit:edit' unit.id as url %}
                        {% modal_link url=url text=text css_class='dropdown-item' %}

                        <div class="dropdown-divider"></div>

                        {% translate 'Delete' as text %}
                        {% url 'nutrition:weight_unit:delete' unit.id as url %}
                        {% modal_link url=url text=text css_class='dropdown-item' %}
                    </div>
                </div>
                {{ unit.name }}
            </li>
            {% empty %}
            <li class="list-group-item">
                {% translate "Nothing found" %}
            </li>
        {% endfor %}
    </ul>


    {% pagination paginator page_obj %}
{% endblock %}




{#         #}
{# Options #}
{#         #}
{% block options %}
    {% translate 'Add new weight unit' as text %}
    {% modal_link url='nutrition:weight_unit:add' text=text %}
{% endblock %}
